package cc.rengu.redp.bizimpl.upmp.service.impl;

import cc.rengu.redp.bizimpl.upmp.dao.UpmpBAgentInfoMapper;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpBAgentInfo;
import cc.rengu.redp.bizimpl.upmp.service.IUpmpBAgentInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author 刘玉亮.LL
 */
@Service
public class UpmpBAgentInfoServiceImpl extends ServiceImpl<UpmpBAgentInfoMapper, UpmpBAgentInfo> implements IUpmpBAgentInfoService {

    @Override
    public UpmpBAgentInfo findOneByCode(String agentMchntNo, String status,String instId) {
        LambdaQueryWrapper<UpmpBAgentInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UpmpBAgentInfo::getAgentCode, agentMchntNo);
        queryWrapper.eq(UpmpBAgentInfo::getAgentStatus, status);
        queryWrapper.eq(UpmpBAgentInfo::getInstId, instId);
        return baseMapper.selectOne(queryWrapper);
    }
}
